package com.seven.service;

import com.seven.Car;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

import java.awt.print.Book;

/**
 * @Author seven
 * @Date 2020/5/9 11:18
 **/
@Service
public class CarService {
    @RabbitListener(queues = "amqpAdmin.queue")
    public void receive(Car car){
        System.out.println("从对列中获取的消息"+car);
    }
    @RabbitListener(queues = "amqpAdmin.queue")
    public void receive2(Message message){
        System.out.println("message参数"+message.getMessageProperties());
        System.out.println("message body 体"+message.getBody());
    }
}
